<table id="devices_status_datagrid" title="" class="easyui-datagrid" style="width: 100%" url="/admin/devices/status"
       toolbar="#devices-status-datagrid-toolbar" pagination="true" pageSize="50" rownumbers="true" nowrap="false" checkOnSelect="false"
       singleSelect="false"
       tabPosition="bottom" fitColumns="true" fit="true" showFooter="true" striped="false" data-options="">
    <thead>
    <tr>
        <th data-options="field:'ck',checkbox:true"></th>
        <th data-options="field:'codeserial',align:'center',width:100">设备编号</th>
        <th data-options="field:'device_category',align:'center',width:100">设备类型</th>
        <th data-options="field:'device_type',align:'center',width:150">设备型号</th>
        <th data-options="field:'device_address',align:'center',width:150">设备位置</th>
        <th data-options="field:'alarms_times',align:'center',width:50">报警次数</th>
        <th data-options="field:'is_online',align:'center',width:50">设备状态</th>
        <!--<th data-options="field:'alarms_type',align:'center',width:100">报警类型</th>-->
        <th data-options="field:'last_report_time',align:'center',width:100">上次心跳时间</th>
        <th data-options="field:'last_check_time',align:'center',width:100">上次巡检日期</th>
    </tr>
    </thead>
</table>
<style>
    label {
        margin-left: 8px;
    }
</style>
<div id="devices-status-datagrid-toolbar" style="padding:5px;height:auto">
    <form style="margin:15px;">
        <label for="status_keyword">设备编号：</label> <input type="text" class="easyui-textbox" id="status_keyword" style="margin-right: 5px">
        <label for="devices_status">设备状态：</label>
        <select name="devices_status" id="devices_status" class="easyui-combobox" style="width: 100px" panelMaxHeight="200px;"
                data-options="panelHeight:'auto'">
            <option value="-1">全部</option>
            <option value="0">离线</option>
            <option value="1">在线</option>
        </select>
        <!--<label for="alarms_type">报警类型：</label>-->
        <!--<select name="alarms_type" id="alarms_type" class="easyui-combobox" style="width: 100px">-->
            <!--<option value="-1">全部</option>-->
        <!--</select>-->
        <a href="javascript:void(0);" onclick="OperationCpManageModel.search(this);" class="easyui-linkbutton"
           data-options="plain:false,iconCls:'icons-table-table'">查询</a>
    </form>
    <a href="javascript:void(0);" class="easyui-linkbutton" style="margin-left: 20px;" data-options="plain:true,iconCls:'icons-table-table_refresh'"
        onclick="OperationCpManageModel.refresh()">刷新</a>
    <!--<a style="margin-left: 10px;" href="javascript:void(0);" class="easyui-linkbutton"-->
       <!--data-options="plain:false,iconCls:'icons-table-table_edit'" onclick="OperationCpManageModel.import()">导出</a>-->
</div>

<script type="text/javascript">

    var OperationCpManageModel = {
        dialog: '#globel-dialog-div',
        datagrid: '#devices_status_datagrid',


        //刷新
        refresh: function () {
            $(this.datagrid).datagrid('reload');
        },

        //数据查询
        search: function () {
            var keyword = $("#status_keyword").val();
            var status = $("#devices_status").combobox('getValue');
            $(this.datagrid).datagrid("load", {
                keyword: keyword,
                status: status,
            });
        },


    };

</script>